<!DOCTYPE html>
<html>

<head>
    <title>讨论页面</title>
    <meta charset="utf-8">
    <!-- 引入样式文件 -->
    <style>
        /* 全局样式 */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Arial', sans-serif;
        }

        /* 顶部导航栏 */
        .navbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background-color: rgb(64, 115, 84);
            color: #fff;
            padding: 10px 20px;
        }

        .logo {
            font-weight: bold;
            font-size: 24px;
            text-decoration: none;
            color: #fff;
            margin-right: 50px;
        }

        .nav-links {
            display: flex;
            list-style: none;
        }

        .nav-links li {
            margin-right: 10px;
        }

        .nav-links a {
            text-decoration: none;
            color: #fff;
        }

        /* 搜索框 */
        .search-box {
            display: flex;
            align-items: center;
            margin-left: auto;
        }

        .search-box input {
            padding: 5px;
            border: none;
        }

        .search-box button {
            padding: 5px 10px;
            background-color: #555;
            color: #fff;
            border: none;
            cursor: pointer;
        }

        /* 主要内容区域 */
        .container {
            display: flex;
            flex-wrap: wrap;
            height: 100vh;
            /* or any desired height */
        }

        .container>* {
            flex: 1;
        }


        /* 右侧帖子列表 */
        .posts {
            flex-grow: 1;
        }

        .posts h2 {
            font-size: 18px;
            margin-bottom: 10px;
        }

        .posts table {
            width: 100%;
            border-collapse: collapse;
        }

        .posts th,
        .posts td {
            padding: 12px;
            border: 1px solid #ccc;
        }

        .posts th {
            background-color: #f2f2f2;
            font-weight: bold;
            text-align: left;
        }

        .posts td {
            padding: 12px;
            border: 1px solid #ccc;
            width: 25%;
            text-align: left;
        }

        .posts a {
            font-weight: bold;
            text-decoration: none;
            color: #333;
        }

        .a:hover {
            /* background-color: #f2f2f2; */
            color: #7686e0;
        }
    </style>
</head>

<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar">
        <a href="/index_1.html" class="logo">只因华太美</a>
        <ul class="nav-links">
            <li><a href="/error">技术分享</a></li>
            <li><a href="/error">项目交流</a></li>
            <li><a href="/error">就业招聘</a></li>
            <li><a href="/error">其他话题</a></li>
            <li><a href="/post-article">发布新帖子</a></li>
        </ul>
        <div class="search-box">
            <input type="text" placeholder="搜索...">
            <button>搜索</button>
        </div>
    </nav>

    <!-- 主要内容区域 -->
    <main class="container">

        <!-- 右侧帖子列表 -->
        <div class="posts">

            <table>
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>作者</th>
                        <th>标题</th>
                        <th>简介</th>
                    </tr>
                </thead>

                <tbody>
                    {{#discussions_list}}
                    <tr>
                        <td>{{id}}</td>
                        <td>{{author}}</td>
                        <td><a href="/article/{{id}}">{{title}}</a></td>
                        <td>{{desc}}</td>
                    </tr>
                    {{/discussions_list}}
                </tbody>
            </table>
        </div>

    </main>

</body>

</html>